package o;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class cqd implements ThreadFactory {
    private static final AtomicInteger ˋ = new AtomicInteger(1);
    private final String ˊ;
    private final ThreadGroup ˎ;
    private final AtomicInteger ॱ = new AtomicInteger(1);

    public cqd(String str) {
        ThreadGroup threadGroup;
        SecurityManager securityManager = System.getSecurityManager();
        if (securityManager != null) {
            threadGroup = securityManager.getThreadGroup();
        } else {
            threadGroup = Thread.currentThread().getThreadGroup();
        }
        this.ˎ = threadGroup;
        this.ˊ = str + "-" + ˋ.getAndIncrement() + "-thread-";
    }

    public Thread newThread(Runnable runnable) {
        Thread thread = new Thread(this.ˎ, runnable, this.ˊ + this.ॱ.getAndIncrement(), 0);
        thread.setUncaughtExceptionHandler(new cqb(this.ˊ));
        if (thread.isDaemon()) {
            thread.setDaemon(false);
        }
        if (thread.getPriority() != 5) {
            thread.setPriority(5);
        }
        return thread;
    }
}
